package com.example.mysdktest.activities;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.mysdktest.R;
import com.example.mysdktest.base.BaseActivity;

/**
 * Created by baichuan on 2016/11/22.
 */

public class Test03 extends BaseActivity implements View.OnClickListener {
    private static String murl = "http://10.1.1.192:8080/";

    private Button obt;
    private TextView tv;

    @Override
    public int getLaout() {
        return R.layout.ac_test03;
    }

    @Override
    public void initView() {
        obt = (Button) findViewById(R.id.ac_test03_obt01);
        tv = (TextView) findViewById(R.id.ac_test03_otv01);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {
        obt.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ac_test03_obt01:
//               // ant();n
//
//                new Thread(){
//                    @Override
//                    public void run() {
//                        try {
//                           // byte[] ss=MyHttp.get("http://10.1.1.192:8080/");
//                        } catch (IOException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }.start();
                break;
        }
    }

//    public void ant() {
//        AntLog.i("UI=" + Thread.currentThread().getId());
//        HttpAnt.getData(murl, new HttpAnt.HttpListener() {
//
//            @Override
//            public void onResponse(byte[] data) {
//                final String ss = new String(data);
//                AntLog.i(ss);
//                AntLog.i("listener=" + Thread.currentThread().getId());
//                tv.post(new Runnable() {
//                    @Override
//                    public void run() {
//                        tv.setText(ss);
//                        AntLog.i("post=" + Thread.currentThread().getId());
//                    }
//                });
//            }
//        });
//    }
}
